package com.gtw.strategy;

/**
 * 策略枚举一般用于不经常发生变化的策略
 */
public enum StrategyEnum {
    ADD("+"){
        @Override
        public int exec(int a, int b) {
            return a + b;
        }
    },
    SUB("-"){
        @Override
        public int exec(int a, int b) {
            return a - b;
        }
    };
    String value = "";

    private StrategyEnum(String value) {
        this.value = value;
    }

    public abstract int exec(int a, int b);
}
